﻿using TiaoTiaoCode.Common.Extensions;

namespace TiaoTiaoCode.AutoUpdate.Common.Dtos
{
    public class ProgrameFileDetailView
    {
        /// <summary>
        /// 文件Id
        /// </summary>
        public string Id { get; set; } = default!;

        /// <summary>
        /// 文件名
        /// </summary>
        public string FileName { get; set; } = default!;

        /// <summary>
        /// 相对路径
        /// </summary>
        public string? Catalog { get; set; }

        /// <summary>
        /// 主版本号
        /// </summary>
        public int Major { get; set; }

        /// <summary>
        /// 子版本号
        /// </summary>
        public int Version { get; set; }

        /// <summary>
        /// 修订版本号
        /// </summary>
        public int MinorNumber { get; set; }

        /// <summary>
        /// 编译版本号
        /// </summary>
        public int BuildNumber { get; set; }

        /// <summary>
        /// 自定义版本号
        /// </summary>
        public string? CustomVersion { get; set; }

        /// <summary>
        /// 版本号完整串
        /// </summary>
        public string VersionString => $"{Major}.{Version}.{MinorNumber}.{BuildNumber}{(CustomVersion.TiaoTiaoIsNullOrEmpty() ? string.Empty : $".{CustomVersion}")}";

    }
}
